<template>
 <div>
 <h1>我是父组件！</h1>
 <chas message="我是从父组件来的之静态传递"></chas>

 <chas v-bind:message="msg"></chas>
  <chas v-bind:message="a+b"></chas>
 
  <charef :message='refMsg' ref='refMsg'/> 

<chaEm @getFatherMsg='showMsg'></chaEm>
{{title}}
  


 </div>
</template>

<script>
import cha from "../components/child"
import charef from "../components/childRef"

import chaEm from "../components/childEmit"
 
export default {
    name: 'fater',
    components: {
        chas :cha,
        charef,
        chaEm
    },
    data(){
        return{
            msg: '我是从父组件来的之动态传递',
            a: 1,
            b: 2,
            refMsg : '我是refmsg',
            title:''
        }
    } ,

 
    mounted: function () {
     console.log( this.$refs.refMsg);
  this.$refs.refMsg.getMsg('我是子组件一,通过方法调用的！')
 } ,
 methods:{
     showMsg(title){
  this.title=title;
  }
 }
}
</script>